﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Configuration;

namespace Cwing.UI
{
    public class ValidationSection : ConfigurationSection
    {
        private readonly ConfigurationProperty provider = new ConfigurationProperty("Provider", typeof(String), null, ConfigurationPropertyOptions.IsRequired);
        private readonly ConfigurationProperty mandatoryColor = new ConfigurationProperty("MandatoryColor", typeof(String), "#FFC030", ConfigurationPropertyOptions.None);
        private readonly ConfigurationProperty failureColor = new ConfigurationProperty("FailureColor", typeof(String), "#C03000", ConfigurationPropertyOptions.None);

        [ConfigurationProperty("Provider", IsRequired = true)]
        public String Provider
        {
            get
            {
                return (String)base[this.provider];
            }
            set
            {
                base[this.provider] = value;
            }
        }

        [ConfigurationProperty("MandatoryColor")]
        public String MandatoryColor
        {
            get
            {
                return (String)base[this.mandatoryColor];
            }
            set
            {
                base[this.mandatoryColor] = value;
            }
        }

        [ConfigurationProperty("FailureColor")]
        public String FailureColor
        {
            get
            {
                return (String)base[this.failureColor];
            }
            set
            {
                base[this.failureColor] = value;
            }
        }
    }
}
